/*
* pps_bom
*/
package com.pitop.project.api;

import com.pitop.project.entity.ProjectStaff;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 参与项目的员工 api请求熔断器
 *
 * @author berton
 */
@FeignClient(value = "pps-cloud-provider", fallback = ProjectStaffFeignApiImpl.class)
public interface ProjectStaffFeignApi {
    /**
     * 查询ProjectStaff一个详情信息
     *
     * @param id
     * @param projectCode 项目编码
     * @param accountCode 员工编码
     * @return ProjectStaff
     */
    @GetMapping(value = "/projectStaff/load")
    ProjectStaff load(@RequestParam("id") Long id, @RequestParam("projectCode") String projectCode, @RequestParam("accountCode") String accountCode);


    /**
     * 根据条件id查询ProjectStaff一个详情信息
     *
     * @param id
     * @return ProjectStaff
     */
    @GetMapping(value = "/projectStaff/load/id/{id}")
    ProjectStaff loadById(@RequestParam("id") Long id);

    /**
     * 根据条件projectCode查询ProjectStaff一个详情信息
     *
     * @param projectCode 项目编码
     * @return ProjectStaff
     */
    @GetMapping(value = "/projectStaff/load/projectCode/{projectCode}")
    ProjectStaff loadByProjectCode(@RequestParam("projectCode") String projectCode);

    /**
     * 根据条件accountCode查询ProjectStaff一个详情信息
     *
     * @param accountCode 员工编码
     * @return ProjectStaff
     */
    @GetMapping(value = "/projectStaff/load/accountCode/{accountCode}")
    ProjectStaff loadByAccountCode(@RequestParam("accountCode") String accountCode);

    /**
     * 删除ProjectStaff
     */
    @DeleteMapping("/projectStaff/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("projectCode") String projectCode, @RequestParam("accountCode") String accountCode);


    /**
     * 查询ProjectStaff信息集合
     *
     * @return 分页对象
     */
    @PostMapping(value = "/projectStaff/list")
    List<ProjectStaff> list(@RequestBody ProjectStaff projectStaff, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 查询ProjectStaff信息集合
     *
     * @return 分页对象
     */
    @GetMapping(value = "/projectStaff/list/by")
    List<ProjectStaff> listByPk(@RequestParam("id") Long id, @RequestParam("projectCode") String projectCode, @RequestParam("accountCode") String accountCode, @RequestParam("curPage") int curPage, @RequestParam("pageSize") int pageSize);


    /**
     * 统计ProjectStaff信息数量根据主键
     *
     * @return 总条数
     */
    @GetMapping(value = "/projectStaff/count/by")
    Integer count(@RequestParam("id") Long id, @RequestParam("projectCode") String projectCode, @RequestParam("accountCode") String accountCode);

    /**
     * 统计ProjectStaff信息数量
     *
     * @return 总条数
     */
    @PostMapping(value = "/projectStaff/count")
    Integer count(@RequestBody ProjectStaff projectStaff);


    /**
     * 创建ProjectStaff
     *
     * @return ProjectStaff
     */
    @PostMapping("/projectStaff/build")
    ProjectStaff build(@RequestBody ProjectStaff projectStaff);


    /**
     * 修改ProjectStaff
     *
     * @return ProjectStaff
     */
    @PutMapping("/projectStaff/modify")
    ProjectStaff modify(@RequestBody ProjectStaff projectStaff);


}
